const loginDao = require("../../dao/web/LoginDao")
const { decrypt, generateToken, verifyToken } = require("../../utils")
module.exports = {
    signInService: async (req, res) => {
        const result = await loginDao.signInDao(req, req.body)
        if (result && !result.message) {
            const token = generateToken(JSON.stringify(result))
            res.send({ token, role: result.role, user: result })
        } else {
            res.status(402).send(result.message)
        }
    }
}
